home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994 Marc Parmet.
- * This file is part of the Macintosh port of GNU Emacs.
- *
- * GNU Emacs is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
- #if defined(THINK_C)
- #include <MacHeaders>
- #else
- #include <Types.h>
- #include <Memory.h>
- #include <Resources.h>
- #include <MixedMode.h>
- #include <FragLoad.h>
- #endif
-
- #include "68k-traps.h"
-
- /* This is the PPC glue to the code resource mentioned in 68k-traps.c. */
-
- void
- execute_68k_trap(int (*code)(),char *stack_data,int stack_size,
- struct regs_for_68k_traps *regs)
- {
- Handle execute_68k_trap_Handle;
- static UniversalProcPtr execute_68k_trap_upp = 0L;
-
- if (execute_68k_trap_upp == 0L) {
- execute_68k_trap_Handle = GetResource('CODE',128);
- if (execute_68k_trap_Handle == 0L) ExitToShell();
- HNoPurge(execute_68k_trap_Handle);
- HLock(execute_68k_trap_Handle);
- execute_68k_trap_upp = NewRoutineDescriptor((long (*)())*execute_68k_trap_Handle,
- execute_68k_trap_ProcInfo,kM68kISA);
- }
-
- CallUniversalProc(execute_68k_trap_upp,execute_68k_trap_ProcInfo,
- code,stack_data,stack_size,regs);
- }
-